package com.mofeng.myshop.domain.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.mofeng.myshop.domain.po.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;

/**
 * @author 作者
 * @since 2024-11-10
 */
@Schema(name = "Carmine 实体", description = "卡密")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@TableName("tb_carmine")
public class Carmine extends BaseEntity {

    @Schema(description = "金额")
    @TableField("`money`")
    private String money;

    @Schema(description = "卡密")
    @TableField("`uuid`")
    private String uuid;

    @Schema(description = "使用用户")
    @TableField("`user_id`")
    private Long userId;

    @Schema(description = "是否使用  0没使用 1使用")
    @TableField("`used`")
    private Integer used;

    @TableField(exist = false)
    private UserBase user;

    public void setMoneyDouble(Double money) {
        this.money = String.format("%.3f", money);
    }
}